import * as dd from 'dingtalk-jsapi';

export default {
  // 弹出框
  alert: (params)=>{
    dd.device.notification.alert({
      message: params,
      title: "",//可传空
      buttonName: "确定",
      onSuccess: function () {
        //onSuccess将在点击button之后回调
        /*回调*/
      },
      onFail: function (err) {
      }
    });
  },
  // 修改头部
  setTitle:(params) => {
    document.title = params;
    dd.biz.navigation.setTitle({
      title : params,//控制标题文本，空字符串表示显示默认文本
      onSuccess : function(result) {
        /*结构
        {
        }*/
      },
      onFail : function(err) {}
    });
  }
}
